package com.example.project.vo.model.echarts;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Pillar {


    private List<String> column = new ArrayList<>();
    private List<Long> count = new ArrayList<>();;


    public static Pillar covertToP(List<Biscuits> biscuitsList) {
        Pillar pillar = new Pillar();

        biscuitsList.stream().forEach(biscuits -> {
            pillar.column.add(String.valueOf(biscuits.getName()));
            pillar.count.add(biscuits.getValue());
        });
        return pillar;
    }
}
